<?php
namespace Rainrock\Framework\kernel\base;


/**
*	xml
*/
final class Xml{
	
	private static $xmlObj;
	
	/**
	*	解析
	*/
	public static function decode($sMsg)
	{
		self::$xmlObj = new \DOMDocument();
		self::$xmlObj->loadXML($sMsg);
	}

	/**
	*	获取对应值
	*/
	public static function get($key, $sMsg = '', $xu=0)
	{
		if($sMsg)self::decode($sMsg);
		@$val = self::$xmlObj->getElementsByTagName($key)->item($xu)->nodeValue; 
		return $val;
	}
}